<?php

function make_datepicker() {
	
	$date_now = time();
	$date_now_yy = date("Y",$date_now);
	$date_now_mm = date("m",$date_now);
	$date_now_dd = date("d",$date_now);
	
	$date_index = 0;
	
	$output = "";
	
	for($date_index=0;$date_index<7;$date_index++) {
		$date_value = mktime(0,0,0,$date_now_mm,$date_now_dd-6+$date_index,$date_now_yy);
		if($date_index==6) { $selected="selected"; } else { $selected=""; }
		$output .= "<option $selected value='".date("Y-m-d",$date_value)."'>".date("D d/m/Y",$date_value)."</option>";
	}
	
	return $output;
	
}

?>
